import { HttpUrlVariable } from '@/constants'
import type { CreateOrderResult } from '@/types/consult'
import type { MedicalOrderDetail, OrderPre, OrderQueryParams, PostOrderParams } from '@/types/order'
import RequestHttp from '@/utils/request'

// 获取药品订单详情
export const getPrescriptionOrderAPI = (params: OrderQueryParams) =>
  RequestHttp.get<OrderPre, OrderQueryParams>(HttpUrlVariable.PRESCRIPTION_ORDER_URL, params)

// 预下单接口
export const preOrderAPI = (params: PostOrderParams) =>
  RequestHttp.post<CreateOrderResult, PostOrderParams>(
    HttpUrlVariable.PRESCRIPTION_ORDER_PRE_URL,
    params
  )

// 药品订单详情
export const getPrescriptionOrderDetailAPI = (id: string) =>
  RequestHttp.get<MedicalOrderDetail>(HttpUrlVariable.PRESCRIPTION_ORDER_DETAIL_URL + id)
